package jgl.vajra.management.part.home.fragment;

import androidx.fragment.app.Fragment;

import java.util.ArrayList;
import java.util.List;

import jgl.vajra.management.R;
import jgl.vajra.management.databinding.FragmentHomePageBinding;
import jgl.vajra.management.manager.FragmentManager;
import jgl.vajra.management.part.home.contract.HomePageContract;
import jgl.vajra.management.part.home.viewModel.HomePageViewModel;
import jgl.vajra.management.widget.databindingadapter.BaseBindingItemPresenter;
import jgl.vajra.management.widget.mvvm.factory.CreateViewModel;
import jgl.vajra.management.widget.mvvm.view.BaseMVVMFragment;

@CreateViewModel(HomePageViewModel.class)
public class HomePageFragment extends BaseMVVMFragment<HomePageViewModel, FragmentHomePageBinding> implements HomePageContract.View{

    @Override
    public int getLayoutId() {
        return R.layout.fragment_home_page;
    }

    @Override
    public void initView() {

        List<String> titleList = new ArrayList<>();
        titleList.add("机主端");
        titleList.add("客户端");
        titleList.add("司机端");
        List<Fragment> fragmentList = new ArrayList<>();
        HomeOwnerFragment listFragment1 = FragmentManager.getHomeOwnerFragment(1);
        fragmentList.add(listFragment1);
        HomeTwoFragment listFragment2 = FragmentManager.getHomeTwoFragment(2);
        fragmentList.add(listFragment2);
        TaskPageFragment listFragment3 = FragmentManager.getTaskPageFragment();
        fragmentList.add(listFragment3);
        mBinding.tabLayout.setCustomViewTabLayoutView(getChildFragmentManager(), titleList, fragmentList);
    }


    @Override
    public void initData() {

    }

    @Override
    public void initEvent() {

    }

}
